package com.bootdo.lvyou.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

import com.bootdo.lvyou.dao.LvyouScenicSpotDao;
import com.bootdo.lvyou.domain.LvyouScenicSpot;
import com.bootdo.lvyou.service.LvyouScenicSpotService;



@Service
public class LvyouScenicSpotServiceImpl implements LvyouScenicSpotService {
	@Autowired
	private LvyouScenicSpotDao lvyouScenicSpotDao;
	
	@Override
	public LvyouScenicSpot get(Long id){
		return lvyouScenicSpotDao.get(id);
	}
	
	@Override
	public List<LvyouScenicSpot> list(Map<String, Object> map){
		return lvyouScenicSpotDao.list(map);
	}

	@Override
	public List<LvyouScenicSpot> getByLonLat(Map<String, Object> map) {
		return lvyouScenicSpotDao.getByLonLat(map);
	}

	@Override
	public Integer getByLonLatCount(Map<String, Object> map) {
		return lvyouScenicSpotDao.getByLonLatCount(map);
	}

	@Override
	public int count(Map<String, Object> map){
		return lvyouScenicSpotDao.count(map);
	}
	
	@Override
	public int save(LvyouScenicSpot lvyouScenicSpot){
	
		if(lvyouScenicSpot.getId() != null) {
			return lvyouScenicSpotDao.update(lvyouScenicSpot);
		}else {
			return lvyouScenicSpotDao.save(lvyouScenicSpot);
		}		
	
		
	}
	
	@Override
	public int update(LvyouScenicSpot lvyouScenicSpot){
		return lvyouScenicSpotDao.update(lvyouScenicSpot);
	}
	
	@Override
	public int remove(Long id){
		return lvyouScenicSpotDao.remove(id);
	}
	
	@Override
	public int batchRemove(Long[] ids){
		return lvyouScenicSpotDao.batchRemove(ids);
	}
	
}
